//
//  LocationModel.h
//  lumihui
//
//  Created by oceans on 2018/10/27.
//  Copyright © 2018 ios. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>

typedef NS_ENUM(NSUInteger, LocationStatus) {
    LocationStatusAllow,
    LocationStatusNoServices,
    LocationStatusNotAllow,
    LocationStatusNotRequest,
    LocationStatusLocating,
    LocationStatusFinish,
    LocationStatusFailed,
};

@protocol LocationModelDelegate;

@interface LocationModel : NSObject

@property (assign, nonatomic) LocationStatus locationStatus;
@property (weak, nonatomic) id <LocationModelDelegate> delegate;
- (void)startLocation;
@end

@protocol LocationModelDelegate

- (void)locationModel:(LocationModel*)model statusChanged:(LocationStatus)status;
- (void)locationModel:(LocationModel*)model locationFinished:(NSArray<CLLocation *> *)locations;
- (void)locationModel:(LocationModel*)model locationFailed:(NSError*)error;
@end
